﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class ArticleService
    {
        protected int page;
        ManagePage mym = new ManagePage();

        #region 增加操作=================================
        public bool AddArticle(ps_article model, bool cbIsLock, string title)
        {
            if (cbIsLock == true)
            {
                model.status = 1;
            }
            else
            {
                model.status = 2;
            }
            if (model.Add() > 0)
            {
                //mym.AddAdminLog("增加", "添加通知公告：" + title); //记录日志
                return true;
            }

            return false;
        }
        #endregion

        #region 修改操作=================================
        public bool UpdateArticle(bool result, ps_article model, bool cbIsLock, string title)
        {
            if (cbIsLock == true)
            {
                model.status = 1;
            }
            else
            {
                model.status = 2;
            }
            if (model.Update())
            {
                //mym.AddAdminLog("修改", "修改通知公告:" + title); //记录日志
                result = true;
            }

            return result;
        }
        #endregion

    }
}
